package com.heima.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.crm.pojos.entity.TbUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CrUserMapper extends BaseMapper<TbUser> {

    @Select("select * from tb_user where phonenumber = #{phoneNumber}")
    TbUser getOne(@Param("phoneNumber") String phoneNumber);

    @Update("update tb_user set del_flag = 1 where user_id = #{userId}")
    void deleteByUserId(Long userId);
}
